﻿using System;
using System.Linq;
using Skyper.View;
using Skyper.View.Panorama;
using System.Collections.Generic;
using Skyper.Model;
namespace Skyper.ViewModel {
	public class RecentPanoramaViewModel : PanoramaViewModel {
		#region Constructor
		public RecentPanoramaViewModel() {
			this.Title = "Recent";
			App.Skype.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Skype_PropertyChanged);
			this.Content = new RecentView();
			
		}
		#endregion
		#region Private
		private void Skype_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {
			if (e.PropertyName == "Contacts") {
				this.OnPropertyChanged(e.PropertyName);
			}
		}
		#endregion
		#region Public
		public override string ToString() {
			return "Recent";
		}
		#endregion
		/// <summary>
		/// Gets the available contacts for viewing.
		/// </summary>
		/// <value>The available.</value>
		public IEnumerable<ContactModel> Contacts {
			get {
				return (from n in App.Skype.Contacts
						select n).Take(8).ToArray();
			}
		}
	}
}
